<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // includes() 返回数组中是否包含参数这个元素
        var arr = ["a", "b", "c"];
        var n = arr.includes("a");
        console.log(n);// true/false


        var str = "b";
        if (str === arr[0] || str === arr[1] || str === arr[2]) {
            console.log(true);
        }else{
            console.log(false);
        }

        var isshow = false;
for (let i = 0; i < arr.length; i++) {
    if (str === arr[i]) {
        isshow = true
    }
}
console.log(isshow);


function includes2(array,string) {
    for (let i = 0; i < array.length; i++) {
       if (string === array[i]) {
        return ture;
       }
        
    }
    return false
}
    </script>
</body>

</html>